package com.donn.securitycontrolplatform.alarm.controller;

import com.donn.securitycontrolplatform.alarm.service.AlarmService;
import com.donn.securitycontrolplatform.common.Result;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Tag(name = "AlarmController", description = "声光报警Controller")
@Slf4j
@RequestMapping("/scp/api/alarm")
public class AlarmController {
    @Autowired
    AlarmService service;

    @ApiOperation(value = "声光报警")
    @ResponseBody
    @GetMapping(value = "/start")
    public Result start() {
        return service.start("1");
    }

    @ResponseBody
    @GetMapping(value = "/stop")
    public Result stop() {
        return service.stop("2");
    }
}
